package com.example.demo.mapper;

import com.example.demo.entity.Source;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GaugeMapper {

    @Select("select sum(a) as sumStudent from\n" +
            "\t(select count(stu_id) as a from dashuju \n" +
            "\tunion \n" +
            "\tselect count(stu_id) as a from jisuanjiyingyong \n" +
            "\tunion \n" +
            "\tselect count(stu_id) as a from ruanjiangongcheng \n" +
            "\tunion \n" +
            "\tselect count(stu_id) as a from ruanjianjishu \n" +
            "\tunion \n" +
            "\tselect count(stu_id) as a from wangluogongcheng \n" +
            "\tunion \n" +
            "\tselect count(stu_id) as a from wangluojishu \n" +
            "\tunion \n" +
            "\tselect count(stu_id) as a from wulianwang \n" +
            "\tunion \n" +
            "\tselect count(stu_id) as a from xinxiguanli\n" +
            ") as b")
    List<Source> getSumStudent();

    @Select("select count(a) as sumClass from\n" +
            "\t(select stu_class as a from dashuju GROUP BY stu_class\n" +
            "\tunion \n" +
            "\tselect stu_class as a from jisuanjiyingyong GROUP BY stu_class\n" +
            "\tunion \n" +
            "\tselect stu_class as a from ruanjiangongcheng GROUP BY stu_class\n" +
            "\tunion \n" +
            "\tselect stu_class as a from ruanjianjishu GROUP BY stu_class\n" +
            "\tunion \n" +
            "\tselect stu_class as a from wangluogongcheng GROUP BY stu_class\n" +
            "\tunion \n" +
            "\tselect stu_class as a from wangluojishu GROUP BY stu_class\n" +
            "\tunion \n" +
            "\tselect stu_class as a from wulianwang GROUP BY stu_class\n" +
            "\tunion \n" +
            "\tselect stu_class as a from xinxiguanli GROUP BY stu_class\n" +
            ") as b")
    List<Source> getSumClass();


}
